package com.chanjiedata.changbs.module.mine;

/**
 * 文件名 : UnBindBankActivity
 * 创建者 : MangoWang
 * 创建日期 : 2019/11/28 14:15
 * 微信 : MangoWaWang
 * 邮箱 : 763482205@qq.com
 * 描述 : TODO
 */

import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.chanjiedata.changbs.R;
import com.chanjiedata.changbs.base.BaseActivity;
import com.chanjiedata.changbs.utlis.StatusBarUtil;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class UnBindBankActivity extends BaseActivity {
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.tv_card_id)
    TextView tvCardId;
    @BindView(R.id.tv_bank_name)
    TextView tvBankName;
    private String bank_id;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_un_bind_bank);
        StatusBarUtil.setStatusBarLightMode(this, Color.parseColor("#ffffff"), true);
        ButterKnife.bind(this);
        tvTitle.setText("解绑银行卡");
        initView();
    }

    private void initView() {
        String bank_name = getIntent().getStringExtra("bank_name");
        String bank_number = getIntent().getStringExtra("bank_number");
        bank_id = getIntent().getStringExtra("bank_id");
        tvBankName.setText(bank_name);
        String substring = bank_number.substring(bank_number.length() - 4, bank_number.length());
        tvCardId.setText("**** **** **** " + substring);

    }

    @OnClick({R.id.back_tv, R.id.tv_summit})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.back_tv:
                finish();
                break;
            case R.id.tv_summit:
                submit();
                break;
        }
    }

    private void submit() {
        Intent intent = new Intent(mContext, PayPasswordUnBindCheckActivity.class);
        intent.putExtra("activity_title", "解绑银行卡");
        intent.putExtra("message", "输入支付密码，以验证身份");
        intent.putExtra("title", "解绑银行卡");
        intent.putExtra("card_id", bank_id);
        startActivity(intent);
    }
}
